
function showLoginForm(submitUrl,loginSuccessHandler) {
    var form = new Ext.form.FormPanel({
        baseCls: 'x-plain',
        layout:'absolute',
        url:submitUrl+'?cmd=login',
        defaultType: 'textfield',
        id:'loginForm',
        items: [{
            x: 0,
            y: 5,
            xtype:'label',
            text: Rose.Locale.Login.nameText
        },{
            x: 60,
            y: 0,
            name: 'name',
            allowBlank:false,
            vtype:'alphanum',
            minLength : 2,
            maxLength : 30,
            anchor:'100%'
        },{
            x: 0,
            y: 35,
            xtype:'label',
            text: Rose.Locale.Login.pwText
        },{
            x: 60,
            y: 30,
            name: 'password',
            inputType :'password',
            allowBlank:false,
            vtype:'alphanum',
            minLength : 6,
            maxLength : 12,
            anchor:'100%'
        }]
    });

    var window = new Ext.Window({
        title: Rose.Locale.Login.titleText,
        width: 360,
        height:160,
        layout: 'fit',
        plain:true,
        modal :true,
        resizable : false,
        draggable : false,
        bodyStyle:'padding:5px;',
        buttonAlign:'right',
        items: form,

        buttons: [{
            text: Rose.Locale.Login.sendText,
            listeners: {
            	click: function(){	
        			form.getForm().submit({
        				success:function(f,a){
	        				if(a.result.success=="true"){
	        					loginSuccessHandler();
	        				}else{
	        					Ext.Msg.alert(Rose.Locale.Login.loginFailureTitleText,Rose.Locale.Login.loginFailureText);
	        				}
        				},
        				failure:function(f,a){
        					Ext.Msg.alert(Rose.Locale.Login.failureTitleText,Rose.Locale.Login.failureText);
        				}
        			});
                }
            }
        },{
            text: Rose.Locale.Login.cancelText,
            listeners: {
            	click: function(){		                    
                	form.getForm().reset();
                }
            }
        },/*{
            text: Rose.Locale.Login.passwordText,
            listeners: {
            	click: function(){ 
        			document.forms.mainForm.action=submitUrl+"?cmd=findpw";
		            document.forms.mainForm.submit();
                }
            }
        },*/{
            text: Rose.Locale.Login.registerText,
            listeners: {
            	click: function(){		                    
		        	document.forms.mainForm.action=submitUrl+"?cmd=register";
		            document.forms.mainForm.submit();
                }
            }
        }]
    });

    window.show();
}